<?php

class controller_captcha extends controller
{
	public function __construct()
	{
		parent::__construct();
	}
	
	public function test()
	{
		$captcha = bone::get('captcha');
		$captcha->set_font_color( array(255,0,255) );
		$captcha->draw();

		$captcha->add_point(20);	// 添加20个干扰点
		$captcha->add_line(2);		// 添加2条干扰线
		$captcha->add_border(2, array(255,0,0));	// 添加2像素红色边框
		$captcha->output();
		
		//$session = bone::get_session();
		//$session->set('test_captcha', $captcha->to_string() );
	}

	// 报价验证码
	public function pricing()
	{
		$captcha = bone::get('captcha');
		$captcha->draw();
		$captcha->output();
		
		$session = bone::get_session();
		$session->set('pricing_captcha', $captcha->to_string() );
	}

	public function message()
	{
		$captcha = bone::get('captcha');
		$captcha->draw();
		$captcha->output();
		
		$session = bone::get_session();
		$session->set('message_captcha', $captcha->to_string() );
	}


}
?>